﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;

using AutomationAdmin.ViewModels;

namespace AutomationAdmin.Views
{
    public partial class AutomationAppListPage : Page
    {
        public AutomationAppListPage()
        {
            InitializeComponent();
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private void StackPanel_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            
        }

        private void Border_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            FrameworkElement ele = sender as FrameworkElement;
            if (ele != null)
            {
                //_listAllUsers.Height = ele.ActualHeight - _listAllUsers.Margin.Top - _listAllUsers.Margin.Bottom;
            }
        }

        private void _adItemAuhorizedUsers_Unselected(object sender, RoutedEventArgs e)
        {

        }

        private void TextBox_GotFocus(object sender, RoutedEventArgs e)
        {
            TextBox tb = sender as TextBox;
            if (tb != null)
            {
                if (tb.Text == "Search by Name or SAFE ID")
                {
                    tb.Text = string.Empty;
                    tb.Foreground = new SolidColorBrush(Colors.Black);
                }
            }
        }

        private void TextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            TextBox tb = sender as TextBox;
            if (tb != null)
            {
                if (tb.Text.Trim() == string.Empty)
                {
                    tb.Text = "Search by Name or SAFE ID";
                    tb.Foreground = new SolidColorBrush(Colors.Gray);
                }
            }
        }

    }
}
